//
//  WDWorderOrderWaitVehicleViewModel.m
//  wd-serviceapp
//
//  Created by Bin Tang on 2024/8/5.
//

#import "WDWorderOrderWaitVehicleViewModel.h"

@implementation WDWorderOrderWaitVehicleViewModel

- (void)initialize
{
    [super initialize];
    
    self.title = @"工单界面";
    
    _reqModel = [WDStationTaskScanReceiveReqModel new];
}

- (void)setupData {
//    _reqModel.engineerId = self.serviceModel.en
    _reqModel.taskId = @(self.serviceModel.id);
    _reqModel.stationId = @(self.serviceModel.stationId);
//    _reqModel.taskType = @(self.serviceModel.taskType);
    _reqModel.vehicleVin = self.serviceModel.vehicleVin;
}

/// 扫码接车
/// - Parameter completion: completion description
- (void)requestWithScanReceive:(RequestCompletionBlock)completion {
    @weakify(self);
    WDStationTaskScanReceiveRequest *request = [[WDStationTaskScanReceiveRequest alloc] initWithModel:self.reqModel];
    [request startWithCompletionBlockWithSuccess:^(__kindof TYZBaseRequest * _Nonnull request) {
        @strongify(self);
        [self sendResponseObject:request.responseModelObject completion:completion];
    } failure:^(__kindof TYZBaseRequest * _Nonnull request) {
        @strongify(self);
        [self sendResponseObject:request.responseModelObject completion:completion];
    }];
}

@end
